package com.cph.es.controller;

import com.cph.common.http.HttpResponseResult;
import com.cph.es.enums.ResultEnum;
import com.cph.es.service.AddIndexTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/index_type")
public class AddIndexTypeController {
    @Autowired
    private AddIndexTypeService addIndexTypeService;

    @PostMapping("/create_index")
    public HttpResponseResult createIndexType() {
        Map<String, Object> map = addIndexTypeService.createIndexType();
        return HttpResponseResult.success(map);
    }
    @PostMapping("/delete_index")
    public HttpResponseResult deleteIndexType() {
        Boolean ifDelete = addIndexTypeService.deleteIndexType();
        return  HttpResponseResult.success(ifDelete);
    }


}
